package com.itheima.dao.impl;

import com.itheima.dao.BookDao;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Author 王加鑫
 * @Date 2021/7/22 20:49
 * @Since JDK 1.9
 */
@Repository
/*@Scope("prototype")*/
@Scope("singleton")
public class BookDaoImpl implements BookDao {
    @Override
    public void save() {
        System.out.println("BookDao save ...");
    }

    @PostConstruct
    public void init(){
        System.out.println("BookDaoImpl init ...");
    }

    @PreDestroy
    public void destroy(){
        System.out.println("BookDaoImpl destroy ...");
    }

}
